package com.szholly.data.general.metadata.table;

import com.szholly.data.general.GlobalDataType;
import com.szholly.data.general.RowBase;
import com.szholly.data.general.UrlType;

/**
 * 类功能说明 定义数据连接实体
 * <p>
 * Title: ConnectionRow.java
 * </p>
 * <p>
 * Description:应用平台部
 * </p>
 * <p>
 * Copyright: Copyright (c) 2013
 * </p>
 * <p>
 * Company:北京地林伟业信息技术有限公司
 * </p>
 * 
 * @author chenming
 * @date 2013-4-29 下午03:10:53
 * @version V1.0
 */
public class ConnectionServiceRow extends RowBase {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8886890777225759075L;

	/**
	 * 连接ID
	 */
	public final static String FIELD_URL_CONNECTIONID = "S_URL_CONNECTIONID";

	/**
	 * 连接名称
	 */
	public final static String FIELD_CONNECTIONNAME = "S_SERVICENAME";

	/**
	 * 查询类型
	 */
	public final static String FIELD_QUERYTYPE = "I_QUERYTYPE";

	/**
	 * SERVERURL连接字符串
	 */
	public final static String FIELD_SERVICEURL = "S_SERVICEURL";

	/**
	 * @Title: getConnectionID
	 * @Description: 连接ID
	 * @param @return
	 * @return String 返回类型
	 * @throws
	 */
	public String getURLConnectionID() {
		Object obj = getValue(GlobalDataType.String, FIELD_URL_CONNECTIONID);
		return (String) obj;
	}

	public void setURLConnectionID(String value) {
		setValue(FIELD_URL_CONNECTIONID, value);
	}

	/**
	 * @Title: getConnectionName
	 * @Description: 连接名称
	 * @param @return
	 * @return String 返回类型
	 * @throws
	 */
	public String getConnectionName() {
		return (String) getValue(GlobalDataType.String, FIELD_CONNECTIONNAME);
	}

	public void setConnectionName(String value) {
		setValue(FIELD_CONNECTIONNAME, value);
	}

	/**
	 * @Title: getDataBaseType
	 * @Description: 资源类型
	 * @param @return
	 * @return WorkspaceType 返回类型
	 * @throws
	 */
	public UrlType getQueryType() {
		Object obj = getValue(GlobalDataType.Int32, FIELD_QUERYTYPE);
		if (obj instanceof Integer) {
			Integer bigD = (Integer) obj;
			return UrlType.getTableTypeByTypeId(bigD.intValue());
		} else {
			return UrlType.ArcWFS;
		}
	}

	public void setQueryType(UrlType value) {
		setValue(FIELD_QUERYTYPE, value.getUrlType());
	}

	/**
	 * @Title: getConnectionStr
	 * @Description: 数据库连接字符串
	 * @param @return
	 * @return String 返回类型
	 * @throws
	 */
	public String getServiceUrl() {
		return (String) getValue(GlobalDataType.String, FIELD_SERVICEURL);

	}

	public void setServiceUrl(String value) {
		setValue(FIELD_SERVICEURL, value);
	}
}
